<template>
	<view class="container">

        <view class="goods-list">
            <view class="goods" @click="Common.toUrl('/pages/food/GoodsList')">
                <view class="img">
					<uni-icons custom-prefix="iconfont" color="#28C445" type="iconfont-yudiancan0101" size="40"></uni-icons>
                </view>
                <view class="title">
                    <text>点餐</text>
                </view>
            </view>
            <!-- <view class="goods" @click="Common.toUrl('/pages/food/OrderList')">
                <view class="img">
					<uni-icons custom-prefix="iconfont" color="#28C445" type="iconfont-canzhuoyi" size="40" style="font-weight:bold;"></uni-icons>
                </view>
                <view class="title">
                    <text>桌位</text>
                </view>
            </view> -->
			
			<view class="goods" @click="Common.toUrl('/pages/food/OrderList')">
			    <view class="img">
					<uni-icons custom-prefix="iconfont" color="#28C445" type="iconfont-wok-2" size="40"></uni-icons>
			    </view>
			    <view class="title">
			        <text>待出餐</text>
			    </view>
			</view>
			
			<!-- <view class="goods" @click="toWx()">
			    <view class="img">
					<uni-icons custom-prefix="iconfont" color="#28C445" type="iconfont-wok-2" size="40"></uni-icons>
			    </view>
			    <view class="title">
			        <text>跳到微信</text>
			    </view>
			</view> -->
        </view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				Config: this.$Config,
				Common: this.$Common,
				Auth: this.$Auth,
				ShareUtil: this.$ShareUtil,
				State: this.$store.state,
				Dict: this.$Dict,

			}
		},
		onShow() {

		},
		onLoad(e) {
            if(!this.Auth.isLogin()){
				uni.reLaunch({
					url: '/pages/user/login/PwdLogin'
				})
			}
		},
        onPullDownRefresh() {
        },
        onReachBottom() {
            
        },
		
		onNavigationBarButtonTap() {
		    this.Common.toUrl('/pages/user/index')
		},
		methods: {
			toWx(){
				
				// let url = encodeURIComponent("http://mp.xiongyuelvyou.com/#/pages/login/login");
				
				// let wxUrl = "open.weixin.qq.com/connect/oauth2/authorize?appid=wx0fd4ced65302a224" +
				// 	"&redirect_uri=" + url +
				// 	"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
				
				// let appUrl = "weixin://dl/business/?t=https://mp.weixin.qq.com/s/i_V8L8pYGkiQSKmCwlrQ8A"
				
				// plus.runtime.openURL(appUrl);
				
				
				let articleUrl = "https://mp.weixin.qq.com/s/i_V8L8pYGkiQSKmCwlrQ8A";
				plus.runtime.openURL(articleUrl);
				
				
				// let url = encodeURIComponent("http://mp.xiongyuelvyou.com/#/pages/login/login");
				
				// let wxUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0fd4ced65302a224" +
				// 	"&redirect_uri=" + url +
				// 	"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
				
				// uni.openApp({
				//   appId: 'wx0fd4ced65302a224', // 微信的AppID（需在微信开放平台配置）
				//   path: wxUrl, // 要打开的微信内网页链接
				//   extraData: {},
				//   success: () => console.log('跳转成功'),
				//   fail: (err) => {
				//     console.log('跳转失败', err);
				//     // 如果微信未安装，引导用户下载
				//     uni.showModal({
				//       title: '提示',
				//       content: '未安装微信，是否前往下载？',
				//       success: (res) => {
				//         if (res.confirm) {
				//           // 跳转微信下载页
				//           window.location.href = 'https://weixin.qq.com/';
				//         }
				//       }
				//     });
				//   }
				// });
			}

		}
	}
</script>

<style lang="scss" scoped>
page{background-color: #FFFFFF;}
.goods-list {
    display: grid;
	grid-template-columns:1fr 1fr;
	grid-gap:80rpx; padding:80rpx;
}

.goods-list .goods {
	// display:grid;justify-content:center; align-content:center;
	box-shadow: 5px 4px 8px 1px rgba(0, 0, 0, 0.12);
	padding: 40rpx 0;
	background:#FFFFFF;
}

.goods-list .goods .img {
    // width: 200rpx;
    // height: 200rpx;
	display:grid;justify-content:center; align-content:center;
}

.goods-list .goods .img image {
 //    width: 100%;
 //    height: 100%;
	// border-radius:10px;
}

.goods-list .goods .title {
	text-align:center;
    margin-top: 20rpx;
    font-size: 36rpx;
	font-weight:bold;

}

</style>
